package com.tem.base.dao;

import org.hibernate.Session;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;

/**
 * @Author: tiger
 * @Date:2018/4/28
 * @Description:
 */
public interface IBaseDao<T> {
    public Session getCurrentSession();

    public Serializable save(T o);

    public void delete(T o);

    public void update(T o);

    public void saveOrUpdate(T o);

    public T getById(Class<T> c, Serializable id);

    public T getByHql(String hql);

    public T getByHql(String hql, Map<String, Object> params);

    public List<T> find(String hql);

    public List<T> find(String hql, Map<String, Object> params);

    public List<T> find(String hql, int page, int rows);

    public List<T> find(String hql, Map<String, Object> params, int page, int rows);

    public Long count(String hql);

    public Long count(String hql, Map<String, Object> params);

    public int executeHql(String hql);

    public int executeHql(String hql, Map<String, Object> params);

    public List<Map> findBySql(String sql);

    public List<Map> findBySql(String sql, int page, int rows);

    public List<Map> findBySql(String sql, Map<String, Object> params);

    public List<Map> findBySql(String sql, Map<String, Object> params, int page, int rows);

    public int executeSql(String sql);

    public int executeSql(String sql, Map<String, Object> params);

    public BigInteger countBySql(String sql);

    public BigInteger countBySql(String sql, Map<String, Object> params);
}
